<?php                          
use_javascript('quest.js','last');
use_javascript('wemTabs.js','last');
use_javascript('jquery.multiselect2side.js','last');

use_stylesheet('list.css');
use_stylesheet('sethQUI/jquery.multiselect2side.css');
use_helper('toolsbar');
slot('PageTitle',"Data Quest");
slot('Title',"Data Quest");
?>

<div id="tabs">
    
    <ul>
        <li <?php if ((isset($PlantKpiDays)) or ($kpiDayForm->hasErrors())) echo "class='activeTab'" ?> ><a href='#tab-kpiday'><span> Daily KPI </span></a></li>   
        <li <?php if ((isset($srcDatas)) or ($srcDataForm->hasErrors())) echo "class='activeTab'" ?>><a href='#tab-source'><span> Source Data </span></a></li>
    </ul>
    
    <div id="loader">
            <img  src="/images/loader.gif"/>
            <br>Updating...
     </div>
    
    <div id="tab-kpiday">
        
        <div id="kpidayForm">
            <?php include_partial("quest/kpidayForm", array("form"=>$kpiDayForm))?>
        </div>
   <?php if (isset($KpiDayDatas)){ ?>
        <div id="Show">
            <?php slot('Toolsbar');
                echo createToolbar();
                    echo addButton("Export to Excel", url_for('quest/exportExcel'),array('popup'=>array('window','width=900,height=800,left=300,top=50,location=no,scrollbars =yes,resizable=yes,directories=no,status=no,toolbar=no,menub ar=no')));
                    echo addButton("Send By Email", url_for('quest/newMail'),array('popup'=>array('window','width=900,height=800,left=300,top=50,location=no,scrollbars =yes,resizable=yes,directories=no,status=no,toolbar=no,menub ar=no')));
                echo endToolbar();
            end_slot(); ?>
            <?php include_partial("global/sourceDataTable", array("data"=>$KpiDayDatas))?>
        </div>
   <?php } ?>     
        
    </div>
    
    <div id="tab-source">
        
        <div id="sourceForm">
            <?php include_partial("quest/srcDataForm", array("form"=>$srcDataForm))?>
        </div>
        
        <?php if (isset($srcDatas)){ 
            
                if ($getChart){ ?>
                    <div id="showChart">
                        <?php include_partial("global/sourceDataChart", array("data"=>$srcDatas))?>
                    </div>
      <?php     }
                if ($getTable){ ?> 
                <div id="showTable">
                    <?php slot('Toolsbar');
                        echo createToolbar();
                            echo addButton("Export to Excel", url_for('quest/exportExcel'),array('popup'=>array('window','width=900,height=800,left=300,top=50,location=no,scrollbars =yes,resizable=yes,directories=no,status=no,toolbar=no,menub ar=no')));
                            echo addButton("Send By Email", url_for('quest/newMail'),array('popup'=>array('window','width=900,height=800,left=300,top=50,location=no,scrollbars =yes,resizable=yes,directories=no,status=no,toolbar=no,menub ar=no')));
                        echo endToolbar();
                    end_slot(); ?>
                    <?php include_partial("global/sourceDataTable", array("data"=>$srcDatas))?>
                </div>
      <?php     }
            } ?>   
    </div>
    
</div>

